home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F31880_testCompose.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.6 KB  |  56 lines

  1. <xsl:stylesheet version="1.0" 
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:myFun1="f:myFun1"
  4. xmlns:myFun2="f:myFun2" 
  5. xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  6. exclude-result-prefixes="xsl myFun1 myFun2"
  7. >
  8.   <xsl:import href="compose.xsl"/>
  9.   <xsl:import href="compose-flist.xsl"/>
  10.   
  11.   <!-- to be applied on any xml source -->
  12.   
  13.   <xsl:output method="text"/>
  14.   <myFun1:myFun1/>
  15.   <myFun2:myFun2/>
  16.  
  17.  
  18.   <xsl:template match="/">
  19.   
  20.     <xsl:variable name="vFun1" select="document('')/*/myFun1:*[1]"/>
  21.     <xsl:variable name="vFun2" select="document('')/*/myFun2:*[1]"/>
  22.     Compose:
  23.     (*3).(*2) 3 = 
  24.     <xsl:call-template name="compose">
  25.       <xsl:with-param name="pFun1" select="$vFun1"/>
  26.       <xsl:with-param name="pFun2" select="$vFun2"/>
  27.       <xsl:with-param name="pArg1" select="3"/>
  28.     </xsl:call-template>
  29.     
  30.     <xsl:variable name="vrtfParam">
  31.       <xsl:copy-of select="$vFun1"/>
  32.       <xsl:copy-of select="$vFun2"/>
  33.       <xsl:copy-of select="$vFun1"/>
  34.     </xsl:variable>
  35.     
  36.     Multi Compose:
  37.     (*3).(*2).(*3) 2 = 
  38.     <xsl:call-template name="compose-flist">
  39.       <xsl:with-param name="pFunList" select="msxsl:node-set($vrtfParam)/*"/>
  40.       <xsl:with-param name="pArg1" select="2"/>
  41.     </xsl:call-template>
  42.   </xsl:template>
  43.   
  44.   <xsl:template match="myFun1:*">
  45.     <xsl:param name="pArg1"/>
  46.     
  47.     <xsl:value-of select="3 * $pArg1"/>
  48.   </xsl:template>
  49.  
  50.   <xsl:template match="myFun2:*">
  51.     <xsl:param name="pArg1"/>
  52.     
  53.     <xsl:value-of select="2 * $pArg1"/>
  54.   </xsl:template>
  55. </xsl:stylesheet>
  56.